Main Menu

Search

Showing posts with label crictl commands. Show all posts
Showing posts with label crictl commands. Show all posts

PODMAN / CRIO: How To Manually Test Pulling Container Images From Oracle Container Registry (OCR) Using Podman & CRIO?

We can manually pull nginx container image from Oracle container registry (OCR) from podman or CRIO to test if they are installed correctly and if the images are getting pulled without issues.

Following commands can be used.

Podman

podman pull container-registry.oracle.com/olcne/nginx:1.17.7

CRIO

crictl pull container-registry.oracle.com/olcne/nginx:1.17.7

Keywords:

pulling pull container containers image images container-registry.oracle.com ocr registries issues problems test check testing checking

CRI-O: Command To View And Tail CRIO Container Logs

CRI-O: Command To View And Tail CRIO Container Logs

Below command can be used.


crictl logs -f <container-name>

CRI-O: CRICTL Command To Inspect the CRIO Image

Below command can be used.

crictl inspecti <image>

Below is sample output

sudo crictl inspecti aeaa426620287
{
  "status": {
    "id": "aeaa4266202870b7ba0d8fee810894eb453aba3313b53f91e576153533757871",
    "repoTags": [
      "container-registry.oracle.com/olcne/kube-scheduler:v1.24.15"
    ],
    "repoDigests": [
      "container-registry.oracle.com/olcne/kube-scheduler@sha256:b343679503ab970d3a871fe06ad2f38ac22143acb1f8f42c528f15dc7581b419"
    ],
    "size": "168358862",
    "uid": null,
    "username": "",
    "spec": null,
    "pinned": false
  },
  "info": {
    "labels": {
      "io.buildah.version": "1.24.1"
    },
    "imageSpec": {
      "created": "2023-06-28T20:13:17.64382043Z",
      "architecture": "amd64",
      "os": "linux",
      "config": {
        "Env": [
          "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
        ],
        "Cmd": [
          "/bin/bash"
        ],
        "Labels": {
          "io.buildah.version": "1.24.1"
        }
      },
      "rootfs": {
        "type": "layers",
        "diff_ids": [
          "sha256:0628316eca4c2a871969d47900ae3948f43e49d32f18b45fe3c251dccf944137",
          "sha256:ae88c8b34aaeee558e49dddd8d013bc97a7f0be288a49ec9a1b2948f2a74c872",
          "sha256:858687ff50547be7d4ac583ab0f299f237d52634b36dc0443f6cf914cf8d65af",
          "sha256:910a37f46f92f5fd827d2b160d032e7d7c0be5e0a0b31136933e23bdd2f80e98",
          "sha256:0d841c74e8c57f24af4b639c6b7904542bec91b8312b505a42dd11c8c54b83b5",
          "sha256:16dbfef62e283022aa5bf7669069cad21faf6793d633dc2a0573ecabb2c34a13"
        ]
      },
      "history": [
        {
          "created": "2023-06-15T22:56:06.187379525Z",
          "created_by": "/bin/sh -c #(nop) ADD file:59eae1d2cc3c7d887c9bd2b0272ec94df71538c75bd83c16ee2a3338a2b8eeae in / "
        },
        {
          "created": "2023-06-15T22:56:07.588871894Z",
          "created_by": "/bin/sh -c #(nop) CMD [\"/bin/bash\"]",
          "empty_layer": true
        },
        {
          "created": "2023-06-28T20:11:28.883580841Z",
          "created_by": "/bin/sh -c #(nop) ARG BINARY",
          "empty_layer": true
        },
        {
          "created": "2023-06-28T20:11:29.488990309Z",
          "created_by": "/bin/sh -c #(nop) ARG VERSION",
          "empty_layer": true
        },
        {
          "created": "2023-06-28T20:13:07.000344956Z",
          "created_by": "|3 BINARY=kube-scheduler VERSION=v1.24.15 https_proxy=http://squid.jx.svc.cluster.local:3128 /bin/sh -c microdnf install -y tar which \u0026\u0026    microdnf clean all \u0026\u0026    rm -rf /var/cache/yum/*"
        },
        {
          "created": "2023-06-28T20:13:10.00032873Z",
          "created_by": "/bin/sh -c #(nop) ADD file:86c34be6b61e4b8c36bcb149692818d8a1755c5582daaf56f1f8d0332f8caa69 in /usr/local/bin/${BINARY} "
        },
        {
          "created": "2023-06-28T20:13:14.000290456Z",
          "created_by": "|3 BINARY=kube-scheduler VERSION=v1.24.15 https_proxy=http://squid.jx.svc.cluster.local:3128 /bin/sh -c test -d /LICENSES || ln -s /usr/share/licenses /LICENSES"
        },
        {
          "created": "2023-06-28T20:13:16.000268081Z",
          "created_by": "/bin/sh -c #(nop) ADD file:f5ab50807331c354ee4381ecec1b84d339966912eea48a069ef5635aa3ba9240 in /LICENSES/kubernetes-${VERSION}/LICENSE "
        },
        {
          "created": "2023-06-28T20:13:18.000166977Z",
          "created_by": "/bin/sh -c #(nop) ADD file:90d809482ad16527c55d3c557bea6f5b410c45222966435cd1eec93358e526fe in /LICENSES/kubernetes-${VERSION}/THIRD_PARTY_LICENSES.txt "
        }
      ]
    }
  }
}

CRI-O: CRICTL Command To List CRIO Images

 Below is crictl command to list the crio images.

crictl images

Below is sample output of how images are shown.

        container-registry.oracle.com/olcne/etcd                      3.5.6               f440fa7240c43       165MB

CRI-O: CRICTL Command To Pull Image From Oracle Container Registry Or Other Registries Into CRIO

Below is CRICTL Command To Pull Image From Oracle Container Registry Or Other Registries Into CRIO. Replace image name and registry name as needed in container-registry.oracle.com/olcne/etcd:3.5.6 to pull desired image. 

           sudo crictl pull container-registry.oracle.com/olcne/etcd:3.5.6

CRI-O: Crictl Command To List CRIO POD processes (DevOps)

#sudo crictl ps

Below is sample output.

sudo crictl ps
CONTAINER           IMAGE                                                              CREATED             STATE               NAME                      ATTEMPT             POD ID              POD
dfaea6f702bc4       32c223e729566de3f29b945ce6fc114a12d8220162c2b7ff8423040c283cf10e   4 days ago          Running             coredns                   0                   9c388af849799       coredns-664c775d6f-nfdsg
1032195f67e16       32c223e729566de3f29b945ce6fc114a12d8220162c2b7ff8423040c283cf10e   4 days ago          Running             coredns                   0                   ff8a2123a8e4d       coredns-664c775d6f-tbdvs
857c4fda970f6       52e470e10ebf93ea5d2aa32f5ca2ecfa3a3b2ff8d2015069618429f3bb9cda7a   4 days ago          Running             kube-flannel              0                   361c90687ed62       kube-flannel-ds-7jpxx

CRI-O: How To Connect To CRIO Pod Process (DevOps)

#sudo crictl exec -i -t <container name> bash

Container name can be obtained from crictl ps command output.

CRI-O: Crictl Command To Check CRIO Version (DevOps)

#sudo crictl version

Below is sample output.

Version:  0.1.0
RuntimeName:  cri-o
RuntimeVersion:  1.24.2
RuntimeApiVersion:  v1